import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-05-04
 * 15:14
 */
public class Test {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int a= scan.nextInt();
        int count=0;
        while (a!=0){
            a=a&(a-1);
            count++;
        }
        System.out.println(count);
    }
}
